//
//  NSObject+convenientFrame.m
//  百思不得姐
//
//  Created by 胥鸿儒 on 16/6/13.
//  Copyright © 2016年 xuhongru. All rights reserved.
//

#import "UIView+convenientFrame.h"

@implementation UIView (convenientFrame)

- (void)setXhr_Size:(CGSize)xhr_Size
{
    CGRect frame = self.frame;
    frame.size = xhr_Size;
    self.frame = frame;
}

- (CGSize)xhr_Size
{
    return self.frame.size;
}
- (void)setXhr_Origin:(CGPoint)xhr_Origin
{
    CGRect frame = self.frame;
    frame.origin = xhr_Origin;
    self.frame = frame;
}

- (CGPoint)xhr_Origin
{
    return self.frame.origin;
}
- (void)setXhr_X:(CGFloat)xhr_X
{
    CGRect frame = self.frame;
    frame.origin.x = xhr_X;
    self.frame = frame;
}

- (CGFloat)xhr_X
{
    return self.xhr_Origin.x;
}

- (void)setXhr_Y:(CGFloat)xhr_Y
{
    CGRect frame = self.frame;
    frame.origin.y = xhr_Y;
    self.frame = frame;
}

- (CGFloat)xhr_Y
{
    return self.xhr_Origin.y;
}
- (void)setXhr_Width:(CGFloat)xhr_Width
{
    CGRect frame = self.frame;
    frame.size.width = xhr_Width;
    self.frame = frame;
}
- (CGFloat)xhr_Width
{
    return self.xhr_Size.width;
}

- (void)setXhr_Height:(CGFloat)xhr_Height
{
    CGRect frame = self.frame;
    frame.size.height = xhr_Height;
    self.frame = frame;
}
- (CGFloat)xhr_Height
{
    return self.xhr_Size.height;
}
- (void)setXhr_CenterX:(CGFloat)xhr_CenterX
{
    CGPoint point = self.center;
    point.x = xhr_CenterX;
    self.center = point;
}
- (CGFloat)xhr_CenterX
{
    return self.center.x;
}
- (void)setXhr_CenterY:(CGFloat)xhr_CenterY
{
    CGPoint point = self.center;
    point.y = xhr_CenterY;
    self.center = point;
}
- (CGFloat)xhr_CenterY
{
    return self.center.y;
}
@end
